import RootReducer  from '../reducers'
import { createStore, applyMiddleware, compose } from 'redux';
import ReduxThunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'

/**
 * 配置函数
 * @return {[type]} 返回创建的store
 */
export default function configureStore() {

    const store = createStore(
        RootReducer,  // 根reducer
        compose(
            applyMiddleware(
                ReduxThunk
            ), // 中间件
            composeWithDevTools() // redux-dev-tool工具
        )
    )
    return store
}
